package mypackage;

import java.util.Scanner;

public class testclass6 {
    public static void main(String[] args) {
        //加密数字
        //+5%10翻转
        //jiami();
        jiemi();
    }
    public static void jiami(){
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个整数");
        int num=sc.nextInt();
        int len=0;
        int temp=num;
        while(temp>0) {
            ++len;
            temp/=10;
        }
        int[] arr=new int[len];
        temp=num;
        for (int i = 0; i < arr.length; i++) {
            arr[i]=temp%10;
            arr[i]+=5;
            arr[i]%=10;
            temp/=10;
        }
        System.out.println("加密后的数字为:");
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }
    }
    public static void jiemi(){
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个整数");
        int num=sc.nextInt();
        int len=0;
        int temp=num;
        while(temp>0){
            ++len;
            temp/=10;
        }
        int[] arr=new int[len];
        temp=num;
        int index=0;
        while(temp>0){
            arr[index++]=temp%10;
            temp/=10;
        }
        for (int i = 0; i < arr.length; i++) {
            arr[i]=(arr[i]-5+10)%10;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+" ");
        }
    }
}
